package com.blueocean_health.care.management.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.blueocean_health.care.management.domain.dto.FundsTypeDto;
import com.blueocean_health.care.management.mapper.FundsTypeMapper;
import com.blueocean_health.care.management.mapper.StandardDeptMapper;
import com.blueocean_health.care.management.service.FundsTypeService;

@Service
public class FundsTypeServiceImpl implements FundsTypeService{
	
	@Resource
	private FundsTypeMapper fundsDao;
	
	@Resource
	private StandardDeptMapper deptDao;

	@Override
	public List<FundsTypeDto> selectFundsInfo() {
		List<FundsTypeDto> selectFundsInfo = fundsDao.selectFundsInfo();
		for (FundsTypeDto paramItem : selectFundsInfo) {
			if(paramItem.getChildren().size() == 0){
				paramItem.setChildren(null);
			}
		}
		return selectFundsInfo;
	}

	@Override
	public List<FundsTypeDto> selectDeptInfo() {
		List<FundsTypeDto> selectDeptInfo = deptDao.selectDeptInfo();
//		for (FundsTypeDto paramItem : selectDeptInfo) {
//			if(paramItem.getChildren().size() == 0){
//				paramItem.setChildren(null);
//			}
//		}
		return selectDeptInfo;
	}

}
